package com.tgy.MyFlowable.workflow.listener;

import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;

public class CounterSignTaskListener implements TaskListener{

	private static final long serialVersionUID = 1L;

	@Override
	public void notify(DelegateTask delegateTask) {
		//获取审批表单的同意与不同意属性
		String audit = (String) delegateTask.getVariable("audit");
		int rejectCount = (int)delegateTask.getVariable("rejected");
		//如果选择的是不同意，则否决数加1
		if(audit.equals("2")) {
			delegateTask.setVariable("rejected", ++rejectCount);
		}

	}

}
